/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.maistre.edu.swarnentity;

import fr.maistre.swarn.*;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Louis Maistre
 */
public class bacterie extends MitoseEntity{



	public bacterie(fr.maistre.swarn.DNA DNA, Environement environement,
			Goal goal, ListRessources ressourcesCritiques,
			ListRessources ressources) {
		super(DNA, environement, goal, ressourcesCritiques, ressources);
		// TODO Auto-generated constructor stub
	}

	public bacterie(fr.maistre.swarn.DNA DNA, Environement environement,
			Goal goal, ListRessources ressourcesCritiques) {
		super(DNA, environement, goal, ressourcesCritiques);
		// TODO Auto-generated constructor stub
	}

	@Override
	protected ListRessources getReproductionCost() {
		ListRessources ressources = new ListRessources();
		Ressource r = new Ressource(RessourceNames.Energie, 10);
		Ressource d = new Ressource(RessourceNames.Vitalité, 2);
		ressources.add(r);
		ressources.add(d);
		return ressources;
	}
	
	@Override
	protected void act(char random) {
		switch (random) {
		case 'c':
			this.reproduce(this.getReproductionCost());
			break;
		case 'b':
			this.scanEnvironement();
			break;
		case 'a':
			this.alterEnvironement();

		default:
			break;
		}
		
	}

	@Override
	protected String mutateADN() {
		return DNA.addAllLetterRandom();
	}

	@Override
	protected void scanEnvironement() {
		
		
	}

	@Override
	protected void alterEnvironement() {
		ListRessources ressources = this.environement.getAvalaibleRessources(this);
		this.environement.getRessources(this, ressources);
		
	}
	
	@Override
	protected Entity create(DNA DNA,
			Environement environement, Goal goal,
			ListRessources ressourcesCritiques, ListRessources ressources) {
			bacterie b = new bacterie(DNA, environement, goal, ressourcesCritiques,ressources);
		return b;
	}

	@Override
	protected long setLifetime() {
		// TODO Auto-generated method stub
		return 500;
	}

    
}
